package com.test.mchelepesa.util_rice;

import android.content.Context;
import android.content.pm.PackageManager;
import android.util.Log;

import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;

public class PermissionUtil_rice {

    public static final int REQ_CODE_PERMISSIONS = 300;

    public static final int REQ_CODE_PERMISSIONS_SMS = 400;

    public static final int REQ_CODE_PERMISSIONS_CAMERA = 987;

    //检查权限是否全部获取
    public static boolean checkLaunchPermissions(@NonNull Context context, String... permissions) {
        try {
            for (String permission:permissions){
                if (PackageManager.PERMISSION_GRANTED != ContextCompat.checkSelfPermission(context, permission)) return false;
            }
        } catch (Exception e) {
            StringUtil_rice.printException(e);
        }
        return true;
    }

}
